#!/bin/bash
# SPDX-FileCopyrightText: © 2013 Hewlett-Packard Development Company, L.P.

# SPDX-License-Identifier: GPL-2.0-only

# Script to generate the Functional Test Result together
cd ../reports/functional
echo "" > Functional_Tests_Results.html
ls *-Xunit* > /tmp/test.txt
while read fn; do
  name=`echo $fn|awk -F '-X' '{print $1}'`
  while read line; do
    if echo $line |grep -qE "<h1>Unit Test Results.</h1>"
    then
      echo "<br/><br/><a name="top"></a><h1>$name Test Results.</h1>" >> Functional_Tests_Results.html
    else
       echo $line >> Functional_Tests_Results.html
    fi
  done < $fn
done </tmp/test.txt
rm /tmp/test.txt

